#N canvas 322 25 881 813 10; #X obj 160 178 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X text 222 394 DO NOT FORGET TO SET COMPORT TO THE PORT NUMBER MATCHING THE ARDUINO ON YOUR SYSTEM!; #X obj 91 645 route a d; #X floatatom 69 782 5 0 0 0 - - -; #X obj 194 696 print digitals; #X obj 91 744 unpack f f f f f f; #X floatatom 110 782 5 0 0 0 - - -; #X floatatom 155 783 5 0 0 0 - - -; #X floatatom 196 783 5 0 0 0 - - -; #X floatatom 238 784 5 0 0 0 - - -; #X floatatom 279 784 5 0 0 0 - - -; #X msg 17 310 close; #X obj 91 538 convert/ascii2pd CR; #X floatatom 309 216 5 0 255 0 - - -; #X msg 309 239 list w a 9 \$1; #X text 180 176 Write (digital) pin 13 \, HIGH (1) or LOW (0); #X text 355 215 Set PWM (write analog) of pin 9; #X obj 91 581 route list float symbol; #X floatatom 115 614 5 0 0 0 - - -; #X symbolatom 170 610 10 0 0 0 - - -; #X obj 254 641 print SPECIAL_CHAR; #X text 467 109 Start your messages with the list prefix (or pd2ascii will try to send special characters)!; #X text 574 94 !!!!!!!!!!!!!!!; #X text 577 139 !!!!!!!!!!!!!!!; #X text 225 272 pd2ascii is configured here to automatically append a carriage return (CR) at the end of messages.; #X text 272 572 The route parse the resulting messages. The list \, float or symbol types indicate a complete message. Anything else is a special character.; #X text 445 13 This example uses version 3 of ascii4pd abstractions (included with the SimpleMessageSystem download)!; #X text 18 15 For use with the Arduino SimpleMessageSystem example 1; #X text 241 535 ascii2pd is configured here to output a message when it receives a carriage return (CR).; #X text 224 448 On Linux (and probably OSX) you can run a bash (terminal) command to find out the number of the Arduino (USB) port: visit http://wiki.dataflow.ws/comport for more details.; #X text 223 428 On my Debian machine \, port 4 maps to the Arduino (ttyUSB0); #X obj 112 307 loadbang; #X msg 110 332 stopbit 1; #X text 225 357 DO NOT FORGET TO SET THE STOPBIT AT 1 OR ERRORS WILL OCCUR IN THE STREAM OF DATA!; #X obj 330 732 timer; #X obj 339 700 t b b; #X floatatom 340 766 5 0 0 0 - - -; #X obj 91 415 comport 5 9600; #X msg 124 99 list r a d 7; #X obj 19 699 dac~; #X obj 18 653 osc~ 440; #X msg 142 129 list r d 6; #X text 443 663 Protocal using SimpleMessageSystem Arduino library. Each string needs to end with carrige return (13 in ASCII) Read analog values: r a [a/d] [pin] Read digital pins: r d [pin] Write digital pin: w d [pin] [value] Write analog pins: w a [pin] [value]; #X text 207 99 Read analog value from digital pin 7; #X text 211 129 Read 1 or 0 from digital pin 6; #X obj 91 278 convert/pd2ascii CR; #X obj 91 279 convert/pd2ascii CR; #X obj 21 622 * 500; #X msg 160 205 list w d 12 \$1; #X connect 0 0 48 0; #X connect 2 0 5 0; #X connect 2 0 35 0; #X connect 2 1 4 0; #X connect 5 0 3 0; #X connect 5 1 6 0; #X connect 5 2 7 0; #X connect 5 3 8 0; #X connect 5 4 9 0; #X connect 5 5 10 0; #X connect 11 0 37 0; #X connect 12 0 17 0; #X connect 13 0 14 0; #X connect 14 0 46 0; #X connect 17 0 2 0; #X connect 17 1 18 0; #X connect 17 2 19 0; #X connect 17 3 20 0; #X connect 18 0 47 0; #X connect 31 0 32 0; #X connect 32 0 37 0; #X connect 34 0 36 0; #X connect 35 0 34 0; #X connect 35 1 34 1; #X connect 37 0 12 0; #X connect 38 0 46 0; #X connect 40 0 39 0; #X connect 40 0 39 1; #X connect 41 0 46 0; #X connect 46 0 37 0; #X connect 47 0 40 0; #X connect 48 0 46 0;